\(\int \frac {\tan ^4(e+f x)}{(a+b \tan ^2(e+f x))^{5/2}} \, dx\) [353]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [F(-2)]
   Giac [F(-1)]
   Mupad [F(-1)]

Optimal result

Integrand size = 25, antiderivative size = 131 \[ \int \frac {\tan ^4(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^{5/2}} \, dx=\frac {\arctan \left (\frac {\sqrt {a-b} \tan (e+f x)}{\sqrt {a+b \tan ^2(e+f x)}}\right )}{(a-b)^{5/2} f}-\frac {a \tan (e+f x)}{3 (a-b) b f \left (a+b \tan ^2(e+f x)\right )^{3/2}}+\frac {(a-4 b) \tan (e+f x)}{3 (a-b)^2 b f \sqrt {a+b \tan ^2(e+f x)}} \]

[Out]

arctan((a-b)^(1/2)*tan(f*x+e)/(a+b*tan(f*x+e)^2)^(1/2))/(a-b)^(5/2)/f+1/3*(a-4*b)*tan(f*x+e)/(a-b)^2/b/f/(a+b*
tan(f*x+e)^2)^(1/2)-1/3*a*tan(f*x+e)/(a-b)/b/f/(a+b*tan(f*x+e)^2)^(3/2)

Rubi [A] (verified)

Time = 0.19 (sec) , antiderivative size = 131, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.240, Rules used = {3751, 481, 541, 12, 385, 209} \[ \int \frac {\tan ^4(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^{5/2}} \, dx=\frac {\arctan \left (\frac {\sqrt {a-b} \tan (e+f x)}{\sqrt {a+b \tan ^2(e+f x)}}\right )}{f (a-b)^{5/2}}+\frac {(a-4 b) \tan (e+f x)}{3 b f (a-b)^2 \sqrt {a+b \tan ^2(e+f x)}}-\frac {a \tan (e+f x)}{3 b f (a-b) \left (a+b \tan ^2(e+f x)\right )^{3/2}} \]

[In]

Int[Tan[e + f*x]^4/(a + b*Tan[e + f*x]^2)^(5/2),x]

[Out]

ArcTan[(Sqrt[a - b]*Tan[e + f*x])/Sqrt[a + b*Tan[e + f*x]^2]]/((a - b)^(5/2)*f) - (a*Tan[e + f*x])/(3*(a - b)*
b*f*(a + b*Tan[e + f*x]^2)^(3/2)) + ((a - 4*b)*Tan[e + f*x])/(3*(a - b)^2*b*f*Sqrt[a + b*Tan[e + f*x]^2])

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 385

Int[((a_) + (b_.)*(x_)^(n_))^(p_)/((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Subst[Int[1/(c - (b*c - a*d)*x^n), x]
, x, x/(a + b*x^n)^(1/n)] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && EqQ[n*p + 1, 0] && IntegerQ[n]

Rule 481

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[(-a)*e^(
2*n - 1)*(e*x)^(m - 2*n + 1)*(a + b*x^n)^(p + 1)*((c + d*x^n)^(q + 1)/(b*n*(b*c - a*d)*(p + 1))), x] + Dist[e^
(2*n)/(b*n*(b*c - a*d)*(p + 1)), Int[(e*x)^(m - 2*n)*(a + b*x^n)^(p + 1)*(c + d*x^n)^q*Simp[a*c*(m - 2*n + 1)
+ (a*d*(m - n + n*q + 1) + b*c*n*(p + 1))*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, q}, x] && NeQ[b*c - a*d, 0]
 && IGtQ[n, 0] && LtQ[p, -1] && GtQ[m - n + 1, n] && IntBinomialQ[a, b, c, d, e, m, n, p, q, x]

Rule 541

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_.)*((e_) + (f_.)*(x_)^(n_)), x_Symbol] :> Simp[(
-(b*e - a*f))*x*(a + b*x^n)^(p + 1)*((c + d*x^n)^(q + 1)/(a*n*(b*c - a*d)*(p + 1))), x] + Dist[1/(a*n*(b*c - a
*d)*(p + 1)), Int[(a + b*x^n)^(p + 1)*(c + d*x^n)^q*Simp[c*(b*e - a*f) + e*n*(b*c - a*d)*(p + 1) + d*(b*e - a*
f)*(n*(p + q + 2) + 1)*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, f, n, q}, x] && LtQ[p, -1]

Rule 3751

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[c*(ff/f), Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2
 + ff^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {x^4}{\left (1+x^2\right ) \left (a+b x^2\right )^{5/2}} \, dx,x,\tan (e+f x)\right )}{f} \\ & = -\frac {a \tan (e+f x)}{3 (a-b) b f \left (a+b \tan ^2(e+f x)\right )^{3/2}}+\frac {\text {Subst}\left (\int \frac {a+(a-3 b) x^2}{\left (1+x^2\right ) \left (a+b x^2\right )^{3/2}} \, dx,x,\tan (e+f x)\right )}{3 (a-b) b f} \\ & = -\frac {a \tan (e+f x)}{3 (a-b) b f \left (a+b \tan ^2(e+f x)\right )^{3/2}}+\frac {(a-4 b) \tan (e+f x)}{3 (a-b)^2 b f \sqrt {a+b \tan ^2(e+f x)}}+\frac {\text {Subst}\left (\int \frac {3 a b}{\left (1+x^2\right ) \sqrt {a+b x^2}} \, dx,x,\tan (e+f x)\right )}{3 a (a-b)^2 b f} \\ & = -\frac {a \tan (e+f x)}{3 (a-b) b f \left (a+b \tan ^2(e+f x)\right )^{3/2}}+\frac {(a-4 b) \tan (e+f x)}{3 (a-b)^2 b f \sqrt {a+b \tan ^2(e+f x)}}+\frac {\text {Subst}\left (\int \frac {1}{\left (1+x^2\right ) \sqrt {a+b x^2}} \, dx,x,\tan (e+f x)\right )}{(a-b)^2 f} \\ & = -\frac {a \tan (e+f x)}{3 (a-b) b f \left (a+b \tan ^2(e+f x)\right )^{3/2}}+\frac {(a-4 b) \tan (e+f x)}{3 (a-b)^2 b f \sqrt {a+b \tan ^2(e+f x)}}+\frac {\text {Subst}\left (\int \frac {1}{1-(-a+b) x^2} \, dx,x,\frac {\tan (e+f x)}{\sqrt {a+b \tan ^2(e+f x)}}\right )}{(a-b)^2 f} \\ & = \frac {\arctan \left (\frac {\sqrt {a-b} \tan (e+f x)}{\sqrt {a+b \tan ^2(e+f x)}}\right )}{(a-b)^{5/2} f}-\frac {a \tan (e+f x)}{3 (a-b) b f \left (a+b \tan ^2(e+f x)\right )^{3/2}}+\frac {(a-4 b) \tan (e+f x)}{3 (a-b)^2 b f \sqrt {a+b \tan ^2(e+f x)}} \\ \end{align*}

Mathematica [A] (verified)

Time = 6.07 (sec) , antiderivative size = 260, normalized size of antiderivative = 1.98 \[ \int \frac {\tan ^4(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^{5/2}} \, dx=\frac {\tan ^5(e+f x) \left (1+\frac {b \tan ^2(e+f x)}{a}\right ) \left (\frac {\text {arctanh}\left (\frac {\sqrt {-\tan ^2(e+f x)+\frac {b \tan ^2(e+f x)}{a}}}{\sqrt {1+\frac {b \tan ^2(e+f x)}{a}}}\right ) \sqrt {-\tan ^2(e+f x)+\frac {b \tan ^2(e+f x)}{a}}}{\sqrt {1+\frac {b \tan ^2(e+f x)}{a}}}-\frac {-\tan ^2(e+f x)+\frac {b \tan ^2(e+f x)}{a}}{1+\frac {b \tan ^2(e+f x)}{a}}-\frac {\left (-\tan ^2(e+f x)+\frac {b \tan ^2(e+f x)}{a}\right )^2}{3 \left (1+\frac {b \tan ^2(e+f x)}{a}\right )^2}\right )}{a^2 f \sqrt {a+b \tan ^2(e+f x)} \left (-\tan ^2(e+f x)+\frac {b \tan ^2(e+f x)}{a}\right )^3} \]

[In]

Integrate[Tan[e + f*x]^4/(a + b*Tan[e + f*x]^2)^(5/2),x]

[Out]

(Tan[e + f*x]^5*(1 + (b*Tan[e + f*x]^2)/a)*((ArcTanh[Sqrt[-Tan[e + f*x]^2 + (b*Tan[e + f*x]^2)/a]/Sqrt[1 + (b*
Tan[e + f*x]^2)/a]]*Sqrt[-Tan[e + f*x]^2 + (b*Tan[e + f*x]^2)/a])/Sqrt[1 + (b*Tan[e + f*x]^2)/a] - (-Tan[e + f
*x]^2 + (b*Tan[e + f*x]^2)/a)/(1 + (b*Tan[e + f*x]^2)/a) - (-Tan[e + f*x]^2 + (b*Tan[e + f*x]^2)/a)^2/(3*(1 +
(b*Tan[e + f*x]^2)/a)^2)))/(a^2*f*Sqrt[a + b*Tan[e + f*x]^2]*(-Tan[e + f*x]^2 + (b*Tan[e + f*x]^2)/a)^3)

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(290\) vs. \(2(117)=234\).

Time = 0.07 (sec) , antiderivative size = 291, normalized size of antiderivative = 2.22

method result size
derivativedivides \(-\frac {\tan \left (f x +e \right )}{3 f a \left (a +b \tan \left (f x +e \right )^{2}\right )^{\frac {3}{2}}}-\frac {2 \tan \left (f x +e \right )}{3 f \,a^{2} \sqrt {a +b \tan \left (f x +e \right )^{2}}}-\frac {\tan \left (f x +e \right )}{3 f b \left (a +b \tan \left (f x +e \right )^{2}\right )^{\frac {3}{2}}}+\frac {\tan \left (f x +e \right )}{3 f a b \sqrt {a +b \tan \left (f x +e \right )^{2}}}-\frac {b \tan \left (f x +e \right )}{f \left (a -b \right )^{2} a \sqrt {a +b \tan \left (f x +e \right )^{2}}}+\frac {\sqrt {b^{4} \left (a -b \right )}\, \arctan \left (\frac {b^{2} \left (a -b \right ) \tan \left (f x +e \right )}{\sqrt {b^{4} \left (a -b \right )}\, \sqrt {a +b \tan \left (f x +e \right )^{2}}}\right )}{f \left (a -b \right )^{3} b^{2}}-\frac {b \tan \left (f x +e \right )}{3 a \left (a -b \right ) f \left (a +b \tan \left (f x +e \right )^{2}\right )^{\frac {3}{2}}}-\frac {2 b \tan \left (f x +e \right )}{3 f \left (a -b \right ) a^{2} \sqrt {a +b \tan \left (f x +e \right )^{2}}}\) \(291\)
default \(-\frac {\tan \left (f x +e \right )}{3 f a \left (a +b \tan \left (f x +e \right )^{2}\right )^{\frac {3}{2}}}-\frac {2 \tan \left (f x +e \right )}{3 f \,a^{2} \sqrt {a +b \tan \left (f x +e \right )^{2}}}-\frac {\tan \left (f x +e \right )}{3 f b \left (a +b \tan \left (f x +e \right )^{2}\right )^{\frac {3}{2}}}+\frac {\tan \left (f x +e \right )}{3 f a b \sqrt {a +b \tan \left (f x +e \right )^{2}}}-\frac {b \tan \left (f x +e \right )}{f \left (a -b \right )^{2} a \sqrt {a +b \tan \left (f x +e \right )^{2}}}+\frac {\sqrt {b^{4} \left (a -b \right )}\, \arctan \left (\frac {b^{2} \left (a -b \right ) \tan \left (f x +e \right )}{\sqrt {b^{4} \left (a -b \right )}\, \sqrt {a +b \tan \left (f x +e \right )^{2}}}\right )}{f \left (a -b \right )^{3} b^{2}}-\frac {b \tan \left (f x +e \right )}{3 a \left (a -b \right ) f \left (a +b \tan \left (f x +e \right )^{2}\right )^{\frac {3}{2}}}-\frac {2 b \tan \left (f x +e \right )}{3 f \left (a -b \right ) a^{2} \sqrt {a +b \tan \left (f x +e \right )^{2}}}\) \(291\)

[In]

int(tan(f*x+e)^4/(a+b*tan(f*x+e)^2)^(5/2),x,method=_RETURNVERBOSE)

[Out]

-1/3/f*tan(f*x+e)/a/(a+b*tan(f*x+e)^2)^(3/2)-2/3/f/a^2*tan(f*x+e)/(a+b*tan(f*x+e)^2)^(1/2)-1/3/f/b*tan(f*x+e)/
(a+b*tan(f*x+e)^2)^(3/2)+1/3/f/a/b*tan(f*x+e)/(a+b*tan(f*x+e)^2)^(1/2)-1/f*b/(a-b)^2*tan(f*x+e)/a/(a+b*tan(f*x
+e)^2)^(1/2)+1/f/(a-b)^3*(b^4*(a-b))^(1/2)/b^2*arctan(b^2*(a-b)/(b^4*(a-b))^(1/2)/(a+b*tan(f*x+e)^2)^(1/2)*tan
(f*x+e))-1/3*b*tan(f*x+e)/a/(a-b)/f/(a+b*tan(f*x+e)^2)^(3/2)-2/3/f*b/(a-b)/a^2*tan(f*x+e)/(a+b*tan(f*x+e)^2)^(
1/2)

Fricas [A] (verification not implemented)

none

Time = 0.33 (sec) , antiderivative size = 498, normalized size of antiderivative = 3.80 \[ \int \frac {\tan ^4(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^{5/2}} \, dx=\left [-\frac {3 \, {\left (b^{2} \tan \left (f x + e\right )^{4} + 2 \, a b \tan \left (f x + e\right )^{2} + a^{2}\right )} \sqrt {-a + b} \log \left (-\frac {{\left (a - 2 \, b\right )} \tan \left (f x + e\right )^{2} - 2 \, \sqrt {b \tan \left (f x + e\right )^{2} + a} \sqrt {-a + b} \tan \left (f x + e\right ) - a}{\tan \left (f x + e\right )^{2} + 1}\right ) - 2 \, {\left ({\left (a^{2} - 5 \, a b + 4 \, b^{2}\right )} \tan \left (f x + e\right )^{3} - 3 \, {\left (a^{2} - a b\right )} \tan \left (f x + e\right )\right )} \sqrt {b \tan \left (f x + e\right )^{2} + a}}{6 \, {\left ({\left (a^{3} b^{2} - 3 \, a^{2} b^{3} + 3 \, a b^{4} - b^{5}\right )} f \tan \left (f x + e\right )^{4} + 2 \, {\left (a^{4} b - 3 \, a^{3} b^{2} + 3 \, a^{2} b^{3} - a b^{4}\right )} f \tan \left (f x + e\right )^{2} + {\left (a^{5} - 3 \, a^{4} b + 3 \, a^{3} b^{2} - a^{2} b^{3}\right )} f\right )}}, \frac {3 \, {\left (b^{2} \tan \left (f x + e\right )^{4} + 2 \, a b \tan \left (f x + e\right )^{2} + a^{2}\right )} \sqrt {a - b} \arctan \left (-\frac {\sqrt {b \tan \left (f x + e\right )^{2} + a}}{\sqrt {a - b} \tan \left (f x + e\right )}\right ) + {\left ({\left (a^{2} - 5 \, a b + 4 \, b^{2}\right )} \tan \left (f x + e\right )^{3} - 3 \, {\left (a^{2} - a b\right )} \tan \left (f x + e\right )\right )} \sqrt {b \tan \left (f x + e\right )^{2} + a}}{3 \, {\left ({\left (a^{3} b^{2} - 3 \, a^{2} b^{3} + 3 \, a b^{4} - b^{5}\right )} f \tan \left (f x + e\right )^{4} + 2 \, {\left (a^{4} b - 3 \, a^{3} b^{2} + 3 \, a^{2} b^{3} - a b^{4}\right )} f \tan \left (f x + e\right )^{2} + {\left (a^{5} - 3 \, a^{4} b + 3 \, a^{3} b^{2} - a^{2} b^{3}\right )} f\right )}}\right ] \]

[In]

integrate(tan(f*x+e)^4/(a+b*tan(f*x+e)^2)^(5/2),x, algorithm="fricas")

[Out]

[-1/6*(3*(b^2*tan(f*x + e)^4 + 2*a*b*tan(f*x + e)^2 + a^2)*sqrt(-a + b)*log(-((a - 2*b)*tan(f*x + e)^2 - 2*sqr
t(b*tan(f*x + e)^2 + a)*sqrt(-a + b)*tan(f*x + e) - a)/(tan(f*x + e)^2 + 1)) - 2*((a^2 - 5*a*b + 4*b^2)*tan(f*
x + e)^3 - 3*(a^2 - a*b)*tan(f*x + e))*sqrt(b*tan(f*x + e)^2 + a))/((a^3*b^2 - 3*a^2*b^3 + 3*a*b^4 - b^5)*f*ta
n(f*x + e)^4 + 2*(a^4*b - 3*a^3*b^2 + 3*a^2*b^3 - a*b^4)*f*tan(f*x + e)^2 + (a^5 - 3*a^4*b + 3*a^3*b^2 - a^2*b
^3)*f), 1/3*(3*(b^2*tan(f*x + e)^4 + 2*a*b*tan(f*x + e)^2 + a^2)*sqrt(a - b)*arctan(-sqrt(b*tan(f*x + e)^2 + a
)/(sqrt(a - b)*tan(f*x + e))) + ((a^2 - 5*a*b + 4*b^2)*tan(f*x + e)^3 - 3*(a^2 - a*b)*tan(f*x + e))*sqrt(b*tan
(f*x + e)^2 + a))/((a^3*b^2 - 3*a^2*b^3 + 3*a*b^4 - b^5)*f*tan(f*x + e)^4 + 2*(a^4*b - 3*a^3*b^2 + 3*a^2*b^3 -
 a*b^4)*f*tan(f*x + e)^2 + (a^5 - 3*a^4*b + 3*a^3*b^2 - a^2*b^3)*f)]

Sympy [F]

\[ \int \frac {\tan ^4(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^{5/2}} \, dx=\int \frac {\tan ^{4}{\left (e + f x \right )}}{\left (a + b \tan ^{2}{\left (e + f x \right )}\right )^{\frac {5}{2}}}\, dx \]

[In]

integrate(tan(f*x+e)**4/(a+b*tan(f*x+e)**2)**(5/2),x)

[Out]

Integral(tan(e + f*x)**4/(a + b*tan(e + f*x)**2)**(5/2), x)

Maxima [F(-2)]

Exception generated. \[ \int \frac {\tan ^4(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^{5/2}} \, dx=\text {Exception raised: ValueError} \]

[In]

integrate(tan(f*x+e)^4/(a+b*tan(f*x+e)^2)^(5/2),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(b-a>0)', see `assume?` for mor
e details)Is

Giac [F(-1)]

Timed out. \[ \int \frac {\tan ^4(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^{5/2}} \, dx=\text {Timed out} \]

[In]

integrate(tan(f*x+e)^4/(a+b*tan(f*x+e)^2)^(5/2),x, algorithm="giac")

[Out]

Timed out

Mupad [F(-1)]

Timed out. \[ \int \frac {\tan ^4(e+f x)}{\left (a+b \tan ^2(e+f x)\right )^{5/2}} \, dx=\int \frac {{\mathrm {tan}\left (e+f\,x\right )}^4}{{\left (b\,{\mathrm {tan}\left (e+f\,x\right )}^2+a\right )}^{5/2}} \,d x \]

[In]

int(tan(e + f*x)^4/(a + b*tan(e + f*x)^2)^(5/2),x)

[Out]

int(tan(e + f*x)^4/(a + b*tan(e + f*x)^2)^(5/2), x)